TECHNICAL REPORT Identifying Unnecessary Bounds Checks Through Block-Qualified Variable Elimination
نویسنده
چکیده
Java’s memory-safety relies on the Java Virtual Machine checking that each access to an array does not exceed the bounds of that array. When static analysis can determine that some array access instruction will never use an out of bounds index, the cost of dynamically checking the index each time the instruction is executed can be avoided. This report introduces Block-Qualified Variable Elimination (BQVE) as a program analysis technique that extends Fourier-Motzkin Elimination [5, 3], so that it can be applied directly to programs in Static Single Assignment Form (SSA) [2] in order to determine whether array accesses of such programs are in bounds. This is accomplished by performing the variable elimination on a constraint system, where each constraint consists of a linear inequality the program’s variables and a blockvalidity qualifier that specifies in what program regions the linear inequality holds. Additional modifications handle SSA’s φ-functions. In summary, the BQVE algoirthm works as follows: BQVE operates on SSA programs for which a control flow graph and a dominator tree have been computed. From such a program, a set of block-qualified linear program constraints consistent with the program’s semantics is extracted from the program code. These constraints are combined with additional constraints derived from properties that are to be tested (e.g., that a particular array access never exceeds its upper bounds) to form a system of constraints. The BQVE algorithm then operates by eliminating non-φ variables from the constraint system and introducing new constraints derived from the old constraints that involved the eliminated variables or were related to φ-functions. After all variables have been eliminated and the φ-functions have been processed, the resulting constraint system can be examined to determine whether the property in
منابع مشابه
Safe, multiphase bounds check elimination in Java
As part of its type-safety regime, the Java semantics require precise exceptions at runtime when programs attempt out-of-bound array accesses. This paper describes a Java implementation that utilizes a multiphase approach to identifying safe array accesses. This approach reduces runtime overhead by spreading the out-of-bounds checking effort across three phases of compilation and execution: pro...
متن کاملTECHNICAL REPORT TR99-02 Type-Based Useless Variable Elimination
We show a type-based method for useless variable elimination, i.e., transformation that eliminates variables whose values contribute nothing to the nal outcome of a computation, and prove its correctness. The algorithm is a surprisingly simple extension of the usual type reconstruction algorithm. Our method seems more attractive than Wand and Siveroni's 0CFA-based method in many respects. First...
متن کاملhe Impacts of Bounced Checks on Economic Growth Through the Banking Credit Risk Channel Emphasis on Enforcement of Laws: Provincial Panel Approach
This study investigates the relation between bounced checks and economic growth through the banking credit risk channel by estimation of a simultaneous equation system with panel data for 31 Iranian provinces covers the years from 2011 to 2015. For this purpose, after identifying determinants of the bounced checks, the relations of this variable with the non-performing loans, banking loans and ...
متن کاملCompile Time Elimination of Null- and Bounds-Checks
SafeTSA is a new type safe intermediate representation for mobile code based on static single assignment form. We developed SafeTSA as an alternative to the Java Virtual Machine. Programs in SafeTSA contain explicit nulland bounds-check instructions, allowing their elimination. Type safety is maintained by enforcing the use of only nulland bounds-checked values in dereference and index operatio...
متن کاملCodes on Graphs and Analysis of Iterative Algorithms for Reconstructing Sparse Signals and Decoding of Check-Hybrid GLDPC Codes
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 1. Preliminaries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 1.1. Block Codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 1.1.1. Linear Block Codes . . . . . . . . . . . . . . . . . . 22 1.2. Commun...
متن کامل